package com.rd.student.jiaji.class2.huangyiming.Day0801;

public class TestArray {
    public static void main(String[] args) {
        int[] arr = {1, 3, 5, 7, 9, 11, 13, 15, 17, 0};
        int newValue = 10;

        int cnt = 9;
        int index = 0;


        for (int i = 0; i < cnt; i++) {
            if (arr[i] == 9) {
                index = i;
                break;
            }
        }

        for (int i = cnt; i > index; i--) {
            arr[i] = arr[i - 1];
        }

        arr[index + 1] = newValue;

        for (int i = 0; i <= cnt; i++) {
            System.out.print(arr[i] + ",");
        }
    }
}
